/**
 * 开始面试
 */
import React from 'react';
import { withRouter, router } from 'umi';
import helper from '@/utils/auth/helper';
import { newTabProps } from '@/utils/tab';
import { Icon } from '../../components';

const { checkCode } = helper;

function InterviewStartOperate({ candidateId, arrangeId, ...rest }) {
    const handleJump = React.useCallback(() => {
        history.push({
            pathname: '/office/personnelManagement/recruitment/interview/record',
            query: { candidateId, arrangeId },
            ...newTabProps
        });
    }, [candidateId, arrangeId]);
    return (
        (checkCode('office:recruitment:course:interview:record') ||
            checkCode('office:recruitment:course:interviewMgt:record')) && (
            <Icon title="开始面试" type="listfunction_startinterview_icon_default" onClick={handleJump} {...rest} />
        )
    );
}
export default withRouter(InterviewStartOperate);
